"""ArticlePlatform URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.1/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include
from django.conf.urls.static import static
from . import settings
from weekly.views import *

urlpatterns = [
    # Page List
    path('admin/', admin.site.urls),
    path('', home, name='home_page'),
    path('login/', Login, name='login_page'),
    path('article_upload/', article_upload, name='article_upload_page'),
    path('article/<slug:num>/<slug:year>/<int:half>/<int:week>/', article_detail, name='article_detail_page'),
    path('archive/', archive, name='archive_page'),
    path('person_list/', person_list, name='person_list_page'),
    # API List
    path('api_login/', api_login, name='api_login'),
    path('api_logout/', api_logout, name='api_logout'),
    path('api_article_upload/', api_article_upload, name='api_article_upload'),
]

# 配置静态页面
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
